freecivfandomcom-20200223-history
Map format
The freeciv map format is quite simple. In theory it is even possible to edit it by hand. Basic information *Maps are always two-dimensional. They may wrap at the north-south and east-west directions to form a flat map, a cylinder, or a torus (donut). *The map generator treats a "wrapx wrapy" donut as ordinary egg-like globe with two poles, and scrolling in any direction (u'p, '''r'ight, 'd'own, or 'l'eft) arrives back at the start after some time. *For a "wrapx" cylinder the map generator arranges the two poles as no-fly zones, and scrolling up or down will hit hard northern and southern ice borders. *No wrapping at all is suited for most scenarios, and scrolling in any direction hits one of the four hard map borders. *Arguably "wrapy" without "wrapx" (old index 2, 6, 10, or 14) is pointless, use "wrapx" to get plausible ice borders for the poles. *Arguably "hex" without "iso" (old index 8, 9, 10, or 11) is unsuited for displays in landscape format (width greater than height). Individual tiles may be rectangular or hexagonal (hex), with either a classic or isometric alignment - this should be set based on the tileset being used. Terrain IDs Single-character unique terrain identifier. The terrain types and their identifiers are defined in terrain.ruleset. Here is a table showing the terrain identifiers of the default ruleset: Layers The map consists of a number of layers, each containing distinct data. The first layer is alway the t layer, which contains the actual terrain through the ids outlined above. This layer is followed by one or several more layers that contain other data, such as rivers, resources, etc. These layers differs between versions, Freeciv 2.0.* and 2.1.* have different ways of saving specials and resources. Rivers Not sure if this is correct... A scenario may define the terrain of the map but not list the specials on it (thus allowing users to control the placement of specials). However rivers are a special case and must be included in the map along with the scenario. Thus in those cases this function should be called to load the river information separate from any other special data. Scenarios can have the "riversoverlay" capability. - RCatYVR In freeciv 2.4 and earlier, rivers are defined in spe01_nnnn as value=" 8 ". The system links or fans the channels depending on the surrounding tiles and any other adjacent value "8"s present, Resources Are not saved in scenario files rather they are randomized each time you load it, save games do save them though Save games (2.3.x) With freeciv 2.3.0 a new savegame format was introduced. The map part of a savegame starts like this: settings set={"name","value","gamestart" "mapsize","FULLSIZE","FULLSIZE" "size",0,0 "tilesperplayer",100,100 "xsize",16,16 "ysize",16,16 "topology","WRAPX|WRAPY","WRAPX|WRAPY" ... } map have_huts=FALSE t0000="h+hf aaaa ff" t0001="dgg aat ff" t0002="hhh pp" t0003="hmp ggghh" t0004="hmh s dghf" t0005=" dg phffpm " t0006=" " t0007="aa sdg aa" t0008="aa h aa" t0009=" jff p " t0010="mh s pdp pm" t0011="gf pdhh " t0012=" gpsg p" t0013=" h hh " t0014="hff gg s" t0015="m+h aaaa m f" startpos_count=5 startpos={"x","y","exclude","nations" 0,2,FALSE,"" 9,11,FALSE,"" 14,0,FALSE,"" 2,5,FALSE,"" 12,3,FALSE,"" } b00_0000="0000000000000000" ... spe00_0000="0000000000000000" ... spe01_0000="0000000000000088" ... spe02_0000="0000000000000000" ... res0000="c c x i y v " ... owner0000="3,3,3,3,-,-,-,-,-,-,-,-,-,-,-,3" ... source0000="242,242,242,242,-,-,-,-,-,-,-,-,-,-,-,242" ... worked0000="-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-," k00_0000="a88880000000222a" ... k01_0000="0000000000000000" ... k02_0000="0000000000000000" ... k03_0000="0000000000000000" ... k04_0000="0000000000000000" ... k05_0000="0000000000000000" ... k06_0000="0000000000000000" ... k07_0000="0000000000000000" ... Settings The map settings like '''topology, map size, ... are saved in the settings section of the savefile. Map definition Terrain Using the Terrain IDs the map is discribed in the tXXXX layer. Starting positions The starting positions are listed in a table with the x and y coordinates, a boolean if it should be excluded and the nation name. Special Layers * bXX_XXX list of all bases located on the map (1=Fortress, 2= Airbase, 3=Both) * spe_XX_XXXX list of all specials located on the map * resXXXX list of all resources located on the map * ownerXXXX owner of the tiles (border information; player number) * sourceXXXX list of all border sources * workedXXXX tile is work by the city with the given ID * kXX_XXXX last seen information, player knowledge Layer Details Resources Dccoper 02:24, November 19, 2010 (UTC) Older formats Save games (2.1.x) Here is a list of layers that is available in save games from Freeciv 2.1.*: t000= res000=" v $ / v " spe00_000="00002089" spe01_000="00002089" spe02_000="00002089" owner="-,-,-,-" /* player number that owns a specific tile*/ source000= /* border logic, what tile gave you access to this tile */ a000= /*these are most probably bitvectores 4 bit per character a,b,c,d,e,g,h,i=4 bit=32 bit */ b000= c000= d000= e000= g000= h000= i000= Save games (2.0.x) t000= l000= u000= n000= f000= a000= b000= c000= d000= e000= g000= h000= i000= Known problems This section is transcluded from Savegames: Video ] :More information will follow... Category:Technical docs